package cn.dkk.create_design.prototype.deep_clone_prototype;

import cn.dkk.create_design.prototype.projo.SchoolClass;
import cn.dkk.create_design.prototype.projo.Student;

public class Test {
    public static void main(String[] args) throws Exception{
        SchoolClass schoolClass = new SchoolClass();
        Student student1 = new Student(schoolClass, "张三");
        Student student2 = student1.clone("李四");
        DeepClonePrototype deepClonePrototype = new DeepClonePrototype(student1);
        DeepClonePrototype clone = deepClonePrototype.clone();
        clone.setStudent(student2);
        System.out.println(deepClonePrototype);
        System.out.println(clone);
    }
}
